Robot milking and automatic milking systems (AMS) have become increasingly popular during recent years due to its capabilities of eliminating labor; offering milking consistency, increased milking frequency, and herd management; and providing lower stress environment for the milking animals. The approach comprises at least one robot arm, which automatically attaches teat cups of a milking machine to the teats of milking animals. To this end some kind of teat position sensing arrangement has to be applied, by aid of which the robot arm can find the teats of the milking animals. Various two-dimensional or three-dimensional camera arrangements have been proposed as such teat position sensing arrangement.
WO 2010/023122 discloses an arrangement for determining positions of the teats of a milking animal in a milking system comprising a milking stall for housing the milking animal during milking, a movable robot arm for automatically attaching teat cups to the teats of the milking animal in the milking stall, and a control device for controlling the movement of the robot arm based on determined positions of the teats of the milking animal. The arrangement comprises a camera directed towards the udder of the milking animal in the milking stall and provided to repeatedly record images of the udder of the milking animal, and processing means provided for repeatedly forming three-dimensional images from the images recorded by the camera; and for detecting the teats of the milking animal and determining their positions in all three spatial dimensions based on the repeatedly formed three-dimensional images.